package controller;

import modele.Square;
import modele.World;
import modele.WorldElem.Earth;
import modele.WorldElem.Grass;
import modele.WorldElem.Rock;
import modele.WorldElem.Sand;
import modele.WorldElem.Tree;
import modele.WorldElem.WaterSource;

public abstract class Rule {
	
	private Square[][] evolvedSquareMap;
	private World world;
	public final static int FIREPROPAGATION1 = 0;
	public final static int WATERFLOW1 = 10;
	public final static int NATURALEVOLUTION = 20;
	public final static int GLOBALRULE = 30;
	
	public Rule(World w){
		setWorld(w);
	}
	
	public abstract void applyRule(Earth e, Square s);
	public abstract void applyRule(Grass g, Square s);
	public abstract void applyRule(Rock r, Square s);
	public abstract void applyRule(Sand sa, Square s);
	public abstract void applyRule(Tree t, Square s);
	public abstract void applyRule(WaterSource ws, Square s);
	public abstract void prepareToEvolve();
	public abstract int getRuleValue();
	
	public Square[][] getEvolvedSquareMap() {
		return evolvedSquareMap;
	}
	public void setEvolvedSquareMap(Square[][] evolvedSquareMap) {
		this.evolvedSquareMap = evolvedSquareMap;
	}

	public World getWorld() {
		return world;
	}

	public void setWorld(World world) {
		this.world = world;
	}
	
	
	
}
